inherited frmTd_InitProductStorage_Edit: TfrmTd_InitProductStorage_Edit
  Left = 484
  Top = 155
  BorderIcons = [biSystemMenu]
  Caption = #21021#22987#21270#36135#21697#24211#23384
  ClientHeight = 478
  ClientWidth = 802
  ExplicitWidth = 810
  ExplicitHeight = 505
  DesignSize = (
    802
    478)
  PixelsPerInch = 96
  TextHeight = 12
  object Label1: TLabel [0]
    Left = 44
    Top = 18
    Width = 60
    Height = 12
    Caption = #20179#24211#21517#31216#65306
    Transparent = True
  end
  object Label2: TLabel [1]
    Left = 44
    Top = 44
    Width = 60
    Height = 12
    Caption = #25104#26412#26680#31639#65306
    Transparent = True
  end
  object Label3: TLabel [2]
    Left = 44
    Top = 68
    Width = 60
    Height = 12
    Caption = #36135#21697#31867#21035#65306
    Transparent = True
  end
  object Label4: TLabel [3]
    Left = 292
    Top = 18
    Width = 60
    Height = 12
    Caption = #36135#21697#21517#31216#65306
    Transparent = True
  end
  object Label5: TLabel [4]
    Left = 292
    Top = 44
    Width = 60
    Height = 12
    Caption = #36135#21697#35268#26684#65306
    Transparent = True
  end
  object LblUnit: TLabel [5]
    Left = 256
    Top = 68
    Width = 96
    Height = 12
    Alignment = taRightJustify
    Caption = #25968#37327'('#22522#26412#21333#20301')'#65306
    Transparent = True
  end
  object LblPrice: TLabel [6]
    Left = 292
    Top = 97
    Width = 60
    Height = 12
    Alignment = taRightJustify
    Caption = #21333'    '#20215#65306
    Transparent = True
  end
  object Label8: TLabel [7]
    Left = 292
    Top = 123
    Width = 60
    Height = 12
    Caption = #37329'    '#39069#65306
    Transparent = True
  end
  object LbltQuantity1: TLabel [8]
    Left = 44
    Top = 97
    Width = 60
    Height = 12
    Alignment = taRightJustify
    Caption = #25968#12288#12288#37327#65306
    Transparent = True
  end
  object LblFzUnit: TLabel [9]
    Left = 268
    Top = 148
    Width = 84
    Height = 12
    Alignment = taRightJustify
    Caption = #36741#21161#21333#20301#25968#37327#65306
    Transparent = True
    Visible = False
  end
  object LbltQuantity2: TLabel [10]
    Left = 44
    Top = 123
    Width = 60
    Height = 12
    Alignment = taRightJustify
    Caption = #25968#12288#12288#37327#65306
    Transparent = True
    Visible = False
  end
  object LbltQuantity3: TLabel [11]
    Left = 44
    Top = 148
    Width = 60
    Height = 12
    Alignment = taRightJustify
    Caption = #25968#12288#12288#37327#65306
    Transparent = True
    Visible = False
  end
  inherited pnlBottom: TPanel
    Top = 418
    Width = 802
    TabOrder = 13
    ExplicitTop = 418
    ExplicitWidth = 802
    inherited Bevel1: TBevel
      Width = 802
      ExplicitWidth = 694
    end
    inherited btnOK: TBitBtn
      Left = 620
      Top = 20
      ExplicitLeft = 620
      ExplicitTop = 20
    end
    inherited btnCancel: TBitBtn
      Left = 710
      Top = 20
      ExplicitLeft = 710
      ExplicitTop = 20
    end
    inherited btnContinue: TBitBtn
      Top = 20
      ExplicitTop = 20
    end
    inherited btnPri: TBitBtn
      Top = 20
      ExplicitTop = 20
    end
    inherited btnNext: TBitBtn
      Top = 20
      ExplicitTop = 20
    end
    inherited btnBaseEditSave: TBitBtn
      Top = 20
      ExplicitTop = 20
    end
  end
  object edtDepot: TcxDBLookupComboBox [13]
    Tag = 7
    Left = 104
    Top = 12
    DataBinding.DataField = 'depotid'
    DataBinding.DataSource = MainDataSource
    Properties.GridMode = True
    Properties.ImmediatePost = True
    Properties.ListColumns = <>
    Properties.ListOptions.SyncMode = True
    TabOrder = 0
    Width = 145
  end
  object EdtProducttype: TcxTextEdit [14]
    Left = 104
    Top = 64
    Enabled = False
    TabOrder = 14
    Width = 145
  end
  object cxLabel1: TcxLabel [15]
    Left = 104
    Top = 42
    Caption = #31227#21160#21152#26435
  end
  object cxLabel2: TcxLabel [16]
    Left = 356
    Top = 42
  end
  object edtProduct: TcxDBLookupComboBox [17]
    Tag = 10
    Left = 356
    Top = 12
    DataBinding.DataField = 'productid'
    DataBinding.DataSource = MainDataSource
    Properties.GridMode = True
    Properties.ImmediatePost = True
    Properties.KeyFieldNames = 'p_id'
    Properties.ListColumns = <
      item
        Caption = #32534#30721
        FieldName = 'code'
      end
      item
        Caption = #36135#21697#21517#31216
        FieldName = 'name'
      end>
    Properties.ListFieldIndex = 1
    Properties.ListOptions.ShowHeader = False
    Properties.ListOptions.SyncMode = True
    TabOrder = 17
    Width = 145
  end
  object PageStorage: TcxPageControl [18]
    Left = 16
    Top = 223
    Width = 500
    Height = 186
    TabOrder = 12
    Properties.ActivePage = tsbill
    Properties.CustomButtons.Buttons = <>
    Properties.Style = 3
    LookAndFeel.Kind = lfFlat
    ClientRectBottom = 186
    ClientRectRight = 500
    ClientRectTop = 24
    object tsbill: TcxTabSheet
      Caption = #25209#21495#24211#23384
      ImageIndex = 0
      object gdBatch: TcxGrid
        Left = 0
        Top = 0
        Width = 500
        Height = 162
        Align = alClient
        PopupMenu = PopInitstorage
        TabOrder = 0
        OnExit = gdBatchExit
        object gdBatchView: TcxGridDBTableView
          OnMouseDown = gdBatchViewMouseDown
          Navigator.Buttons.CustomButtons = <>
          DataController.DataSource = DS_Storage
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <
            item
              Format = ',0.00;-,0.00'
              Kind = skSum
              OnGetText = gdBatchViewTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems0GetText
              Column = amount
              DisplayText = ',0.00;-,0.00'
            end
            item
              Format = ',0.0000;-,0.0000'
              Kind = skSum
              OnGetText = cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems1GetText
              Column = Quantity1
              DisplayText = ',0.0000;-,0.0000'
            end
            item
              Format = ',0.0000;-,0.0000'
              Kind = skSum
              OnGetText = cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems2GetText
              Column = Quantity2
              DisplayText = ',0.0000;-,0.0000'
            end
            item
              Format = ',0.0000;-,0.0000'
              Kind = skSum
              OnGetText = cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems3GetText
              Column = Quantity3
              DisplayText = ',0.0000;-,0.0000'
            end
            item
              Format = ',0.0000;-,0.0000'
              Kind = skSum
              OnGetText = cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems4GetText
              Column = assqty
              DisplayText = ',0.0000;-,0.0000'
            end
            item
              Format = ',0.0000;-,0.0000'
              Kind = skSum
              OnGetText = gdBatchViewTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems5GetText
              Column = bquantity
              DisplayText = ',0.0000;-,0.0000'
            end
            item
              Kind = skCount
              OnGetText = cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems7GetText
              Column = batchcode
            end
            item
              Kind = skAverage
              Column = bprice
            end>
          DataController.Summary.SummaryGroups = <>
          OptionsBehavior.AlwaysShowEditor = True
          OptionsBehavior.FocusCellOnTab = True
          OptionsBehavior.FocusFirstCellOnNewRecord = True
          OptionsBehavior.GoToNextCellOnEnter = True
          OptionsBehavior.FocusCellOnCycle = True
          OptionsData.Appending = True
          OptionsView.Footer = True
          OptionsView.GroupByBox = False
          OptionsView.Indicator = True
          Styles.Background = MainDM.bslBackGroup
          Styles.ContentEven = MainDM.bsEven
          Styles.ContentOdd = MainDM.bsOdd
          Styles.Footer = MainDM.bsTitle
          Styles.Header = MainDM.bsTitle
          Styles.Selection = MainDM.bsSelect
          object batchcode: TcxGridDBColumn
            Caption = #25209#21495
            DataBinding.FieldName = 'batchcode'
            Width = 67
          end
          object Quantity1: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty1'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 4
            Properties.DisplayFormat = ',0.0000;-,0.0000'
            Visible = False
          end
          object Quantity2: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty2'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 4
            Properties.DisplayFormat = ',0.0000;-,0.0000'
            Visible = False
          end
          object Quantity3: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty3'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 4
            Properties.DisplayFormat = ',0.0000;-,0.0000'
            Visible = False
          end
          object assqty: TcxGridDBColumn
            Caption = #36741#21161#21333#20301#25968#37327
            DataBinding.FieldName = 'assqty'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 4
            Properties.DisplayFormat = ',0.00;-,0.00'
            Visible = False
            Width = 86
          end
          object bquantity: TcxGridDBColumn
            Caption = #25968#37327'/'#22522#26412#21333#20301
            DataBinding.FieldName = 'bquantity'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 4
            Properties.DisplayFormat = ',0.0000;-,0.0000'
            Options.Editing = False
            Width = 92
          end
          object bprice: TcxGridDBColumn
            Caption = #21333#20215
            DataBinding.FieldName = 'bprice'
            PropertiesClassName = 'TcxCurrencyEditProperties'
            Properties.DecimalPlaces = 8
            Properties.DisplayFormat = ',0.00000000;-,0.00000000'
            Width = 65
          end
          object amount: TcxGridDBColumn
            Caption = #37329#39069
            DataBinding.FieldName = 'amount'
            Options.Editing = False
            Width = 73
          end
          object productdate: TcxGridDBColumn
            Caption = #29983#20135#26085#26399
            DataBinding.FieldName = 'productdate'
          end
          object validdate: TcxGridDBColumn
            Caption = #26377#25928#26085#26399
            DataBinding.FieldName = 'validdate'
          end
          object custom1: TcxGridDBColumn
            Caption = #29992#25143#33258#23450#20041'1'
            DataBinding.FieldName = 'custom1'
            Visible = False
            Width = 100
          end
          object custom2: TcxGridDBColumn
            Caption = #29992#25143#33258#23450#20041'2'
            DataBinding.FieldName = 'custom2'
            Visible = False
            Width = 100
          end
          object custom3: TcxGridDBColumn
            Caption = #29992#25143#33258#23450#20041'3'
            DataBinding.FieldName = 'custom3'
            Visible = False
            Width = 100
          end
          object colLength: TcxGridDBColumn
            Caption = #38271
            DataBinding.FieldName = 'length'
            Visible = False
            Width = 60
          end
          object colWidth: TcxGridDBColumn
            Caption = #23485
            DataBinding.FieldName = 'width'
            Visible = False
            Width = 60
          end
          object colHeight: TcxGridDBColumn
            Caption = #39640'/'#21402
            DataBinding.FieldName = 'height'
            Visible = False
            Width = 60
          end
        end
        object gdBatchLevel1: TcxGridLevel
          GridView = gdBatchView
        end
      end
    end
    object tslay: TcxTabSheet
      Caption = #36135#20301
      ImageIndex = 1
      object cxGrid2: TcxGrid
        Left = 0
        Top = 0
        Width = 500
        Height = 162
        Align = alClient
        PopupMenu = poptt_billlay
        TabOrder = 0
        object cxGridLay: TcxGridDBTableView
          OnMouseDown = cxGridLayMouseDown
          Navigator.Buttons.CustomButtons = <>
          DataController.DataSource = ds_tt_billlay
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <
            item
              Kind = skCount
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems0GetText
              Column = layid
            end
            item
              Kind = skSum
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems1GetText
              Column = layquantity1
            end
            item
              Kind = skSum
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems2GetText
              Column = layquantity2
            end
            item
              Kind = skSum
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems3GetText
              Column = layquantity3
            end
            item
              Kind = skSum
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems4GetText
              Column = layassqty
            end
            item
              Kind = skSum
              OnGetText = cxGridLayTcxGridDBDataControllerTcxDataSummaryFooterSummaryItems5GetText
              Column = laybquantity
            end>
          DataController.Summary.SummaryGroups = <>
          OptionsBehavior.AlwaysShowEditor = True
          OptionsBehavior.FocusCellOnTab = True
          OptionsBehavior.FocusFirstCellOnNewRecord = True
          OptionsBehavior.GoToNextCellOnEnter = True
          OptionsBehavior.FocusCellOnCycle = True
          OptionsData.Appending = True
          OptionsView.Footer = True
          OptionsView.GroupByBox = False
          OptionsView.Indicator = True
          Styles.Background = MainDM.bslBackGroup
          Styles.ContentEven = MainDM.bsEven
          Styles.ContentOdd = MainDM.bsOdd
          Styles.Footer = MainDM.bsTitle
          Styles.Header = MainDM.bsTitle
          Styles.Selection = MainDM.bsSelect
          object layid: TcxGridDBColumn
            Caption = #36135#20301
            DataBinding.FieldName = 'layid'
            PropertiesClassName = 'TcxLookupComboBoxProperties'
            Properties.DropDownAutoSize = True
            Properties.KeyFieldNames = 'id'
            Properties.ListColumns = <
              item
                Caption = #36135#20301
                Width = 70
                FieldName = 'name'
              end
              item
                Caption = #32534#30721
                Width = 70
                FieldName = 'code'
              end>
            Properties.ListSource = ds_td_lay
            Properties.MaxLength = 0
            Width = 87
          end
          object layquantity1: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty1'
            Visible = False
          end
          object layquantity2: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty2'
            Visible = False
          end
          object layquantity3: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'qty3'
            Visible = False
          end
          object layassqty: TcxGridDBColumn
            Caption = #36741#21161#25968#37327
            DataBinding.FieldName = 'assqty'
            Visible = False
          end
          object laybquantity: TcxGridDBColumn
            Caption = #25968#37327'/'#22522#26412#21333#20301
            DataBinding.FieldName = 'bquantity'
            Options.Editing = False
            Width = 93
          end
        end
        object cxGrid2Level1: TcxGridLevel
          GridView = cxGridLay
        end
      end
    end
    object tsImei: TcxTabSheet
      Caption = #20018#21495#26126#32454
      ImageIndex = 2
      object grdImei: TcxGrid
        Left = 0
        Top = 0
        Width = 500
        Height = 162
        Align = alClient
        TabOrder = 0
        object viewImei: TcxGridDBTableView
          OnMouseDown = viewImeiMouseDown
          Navigator.Buttons.CustomButtons = <>
          DataController.DataSource = ds_tb_productimei
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <
            item
              Kind = skCount
              Column = viewImeiimei
            end
            item
              Kind = skSum
              Column = viewImeiquantity
            end
            item
              Kind = skSum
              Column = viewImeiassqty
            end>
          DataController.Summary.SummaryGroups = <>
          OptionsData.Appending = True
          OptionsView.ColumnAutoWidth = True
          OptionsView.Footer = True
          OptionsView.GroupByBox = False
          OptionsView.GroupFooters = gfAlwaysVisible
          Styles.Background = MainDM.bslBackGroup
          Styles.ContentEven = MainDM.bsEven
          Styles.ContentOdd = MainDM.bsOdd
          Styles.Footer = MainDM.bsTitle
          Styles.Header = MainDM.bsTitle
          Styles.Selection = MainDM.bsSelect
          object viewImeiimei: TcxGridDBColumn
            Caption = #20018#21495
            DataBinding.FieldName = 'imei'
            Width = 70
          end
          object viewImeiquantity: TcxGridDBColumn
            Caption = #25968#37327
            DataBinding.FieldName = 'quantity'
            Width = 60
          end
          object viewImeiassqty: TcxGridDBColumn
            Caption = #36741#21161#25968#37327
            DataBinding.FieldName = 'assqty'
            Width = 60
          end
          object viewImeiexplan: TcxGridDBColumn
            Caption = #35828#26126
            DataBinding.FieldName = 'explan'
            Width = 80
          end
        end
        object lvlImei: TcxGridLevel
          GridView = viewImei
        end
      end
    end
  end
  object LblTishi: TcxLabel [19]
    Left = 525
    Top = 256
    AutoSize = False
    Caption = #25552#31034#65306#22312#25968#37327#12289#25209#21495#12289#36135#20301#39029#38754#21516#26102#26174#31034#26102#65292#25110#32773#20004#20004#32452#21512#26174#31034#26102#65288#20363#22914#65306#25209#21495#12289#36135#20301#39029#38754#26174#31034#65289#65292#25968#37327'/'#22522#26412#21333#20301#21015#24635#30340#21512#35745#25968#24517#39035#30456#31561
    Properties.WordWrap = True
    Transparent = True
    Height = 116
    Width = 105
  end
  object chkInitProduct: TcxCheckBox [20]
    Left = 507
    Top = 143
    Caption = #33258#21160#21021#22987#21270#19979#19968#36135#21697
    Properties.NullStyle = nssUnchecked
    State = cbsChecked
    TabOrder = 9
  end
  object EdtQuantity1: TcxCurrencyEdit [21]
    Left = 104
    Top = 91
    EditValue = 0.000000000000000000
    Properties.DecimalPlaces = 4
    Properties.DisplayFormat = '#0.0000'
    Properties.EditFormat = '#0.0000'
    Properties.Nullable = False
    Properties.OnEditValueChanged = EdtQuantity1PropertiesEditValueChanged
    TabOrder = 4
    Width = 145
  end
  object EdtQuantity2: TcxCurrencyEdit [22]
    Left = 104
    Top = 118
    EditValue = 0.000000000000000000
    Properties.DecimalPlaces = 4
    Properties.DisplayFormat = '#0.0000'
    Properties.EditFormat = '#0.0000'
    Properties.Nullable = False
    Properties.OnEditValueChanged = EdtQuantity1PropertiesEditValueChanged
    TabOrder = 6
    Visible = False
    Width = 145
  end
  object EdtQuantity3: TcxCurrencyEdit [23]
    Left = 104
    Top = 144
    EditValue = 0.000000000000000000
    Properties.DecimalPlaces = 4
    Properties.DisplayFormat = '#0.0000'
    Properties.EditFormat = '#0.0000'
    Properties.Nullable = False
    Properties.OnEditValueChanged = EdtQuantity1PropertiesEditValueChanged
    TabOrder = 8
    Visible = False
    Width = 145
  end
  object EdtPrice: TcxDBCurrencyEdit [24]
    Left = 356
    Top = 92
    DataBinding.DataField = 'bprice'
    DataBinding.DataSource = MainDataSource
    Properties.DecimalPlaces = 8
    Properties.DisplayFormat = '#0.00000000'
    Properties.EditFormat = '#0.00000000'
    TabOrder = 5
    Width = 145
  end
  object EdtAmount: TcxCurrencyEdit [25]
    Left = 356
    Top = 119
    EditValue = 0c
    Properties.DecimalPlaces = 2
    Properties.DisplayFormat = '#0.00'
    Properties.EditFormat = '#0.00'
    Properties.OnValidate = EdtAmountPropertiesValidate
    TabOrder = 7
    Width = 145
  end
  object EdtFzUnit: TcxCurrencyEdit [26]
    Left = 356
    Top = 144
    EditValue = 0.000000000000000000
    Properties.DecimalPlaces = 4
    Properties.DisplayFormat = '#0.0000'
    Properties.EditFormat = '#0.0000'
    Properties.Nullable = False
    TabOrder = 10
    Visible = False
    Width = 145
  end
  object EdtUnit: TcxCurrencyEdit [27]
    Left = 356
    Top = 64
    Enabled = False
    Properties.DecimalPlaces = 4
    Properties.DisplayFormat = '#0.0000'
    Properties.EditFormat = '#0.0000'
    TabOrder = 3
    Width = 145
  end
  object pnlIndustry: TPanel [28]
    Left = 0
    Top = 168
    Width = 972
    Height = 48
    Anchors = [akLeft, akTop, akRight]
    BevelOuter = bvNone
    TabOrder = 11
    object dynlblLength: TLabel
      Left = 48
      Top = 33
      Width = 24
      Height = 12
      Alignment = taRightJustify
      Caption = #38271#65306
      Transparent = True
      Visible = False
    end
    object dynlblWidth: TLabel
      Left = 256
      Top = 33
      Width = 24
      Height = 12
      Alignment = taRightJustify
      Caption = #23485#65306
      Transparent = True
      Visible = False
    end
    object dynlblHeight: TLabel
      Left = 446
      Top = 33
      Width = 42
      Height = 12
      Alignment = taRightJustify
      Caption = #39640'/'#21402#65306
      Transparent = True
      Visible = False
    end
    object dynedtLength: TcxDBCurrencyEdit
      Left = 76
      Top = 28
      DataBinding.DataField = 'length'
      DataBinding.DataSource = MainDataSource
      Properties.DecimalPlaces = 8
      Properties.DisplayFormat = '#0.00000000'
      Properties.EditFormat = '#0.00000000'
      TabOrder = 0
      Visible = False
      Width = 145
    end
    object dynedtWidth: TcxDBCurrencyEdit
      Left = 280
      Top = 28
      DataBinding.DataField = 'width'
      DataBinding.DataSource = MainDataSource
      Properties.DecimalPlaces = 8
      Properties.DisplayFormat = '#0.00000000'
      Properties.EditFormat = '#0.00000000'
      TabOrder = 1
      Visible = False
      Width = 145
    end
    object dynedtHeight: TcxDBCurrencyEdit
      Left = 488
      Top = 28
      DataBinding.DataField = 'height'
      DataBinding.DataSource = MainDataSource
      Properties.DecimalPlaces = 8
      Properties.DisplayFormat = '#0.00000000'
      Properties.EditFormat = '#0.00000000'
      TabOrder = 2
      Visible = False
      Width = 145
    end
  end
  inherited edtPrint: TcxLookupComboBox
    ExplicitHeight = 20
  end
  object edtPCode: TcxTextEdit [31]
    Left = 499
    Top = 12
    Enabled = False
    TabOrder = 19
    Width = 80
  end
  inherited MainDataSource: TDataSource
    DataSet = cdsMainDataSet
    Left = 153
    Top = 178
  end
  inherited qryDynDtl: TUniQuery
    Left = 8
    Top = 24
  end
  object Qry_ProductV: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      
        'select  p.p_id,p.code,p.name as productName,p.spec,p.calccost,p.' +
        'imei,dk.name as depotkindName,k.kid,k.kname,pd.name as productty' +
        'peName,p.batch'
      'from td_product p  '
      'left outer join td_depotkind dk on dk.depotkindid=p.depotkindid'
      'left outer join td_depot d on d.depotid=p.depotid'
      'left outer join td_producttype pd on pd.id=producttypeid'
      'left outer join ts_kind k on k.kid=p.calccost'
      'where (k.kind=5102)')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 560
    Top = 60
    object Qry_ProductVp_id: TIntegerField
      FieldName = 'p_id'
    end
    object Qry_ProductVcode: TStringField
      FieldName = 'code'
      Size = 30
    end
    object Qry_ProductVproductName: TWideStringField
      FieldName = 'productName'
      Size = 60
    end
    object Qry_ProductVspec: TWideStringField
      FieldName = 'spec'
      Size = 60
    end
    object Qry_ProductVdepotkindName: TStringField
      FieldName = 'depotkindName'
      Size = 60
    end
    object Qry_ProductVkid: TIntegerField
      FieldName = 'kid'
    end
    object Qry_ProductVkname: TStringField
      FieldName = 'kname'
      Size = 50
    end
    object Qry_ProductVproducttypeName: TWideStringField
      FieldName = 'producttypeName'
      Size = 60
    end
    object Qry_ProductVbatch: TBooleanField
      FieldName = 'batch'
    end
    object Qry_ProductVcalccost: TByteField
      FieldName = 'calccost'
    end
    object Qry_ProductVimei: TBooleanField
      FieldName = 'imei'
    end
  end
  object Qry_UnitPrice: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select * from td_unitprice')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 560
    Top = 108
  end
  object Qry_Storage: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'Select *, '
      'dbo.f_getunitqty(productid, bquantity, 1) AS qty1,  '
      'dbo.f_getunitqty(productid, bquantity, 2) AS qty2,  '
      'dbo.f_getunitqty(productid, bquantity, 3) AS qty3,'
      'custom1,custom2,custom3 '
      'from tt_bill where btype < 0')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 46
    Top = 254
  end
  object DS_Storage: TDataSource
    DataSet = cds_tt_bill
    Left = 40
    Top = 396
  end
  object cxStyleRepository1: TcxStyleRepository
    Left = 252
    Top = 28
    PixelsPerInch = 96
    object cxStyle1: TcxStyle
    end
    object cxStyle2: TcxStyle
    end
  end
  object PopInitstorage: TPopupMenu
    Left = 129
    Top = 275
    object N1: TMenuItem
      Caption = #26032#22686#25968#25454
      OnClick = N1Click
    end
    object N2: TMenuItem
      Caption = #21024#38500#25968#25454
      OnClick = N2Click
    end
  end
  object cds_tt_bill: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dsp_tt_bill'
    AfterOpen = cds_tt_billAfterOpen
    BeforePost = cds_tt_billBeforePost
    BeforeDelete = cds_tt_billBeforeDelete
    AfterScroll = cds_tt_billAfterScroll
    OnNewRecord = cds_tt_billNewRecord
    OnReconcileError = cds_tt_billReconcileError
    Left = 41
    Top = 347
  end
  object dsp_tt_bill: TDataSetProvider
    DataSet = Qry_Storage
    UpdateMode = upWhereKeyOnly
    BeforeUpdateRecord = dsp_tt_billBeforeUpdateRecord
    Left = 41
    Top = 299
  end
  object cdsMainDataSet: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspMainDataSet'
    BeforePost = cdsMainDataSetBeforePost
    AfterScroll = cdsMainDataSetAfterScroll
    Left = 164
    Top = 120
  end
  object dspMainDataSet: TDataSetProvider
    DataSet = MainDataSetU
    UpdateMode = upWhereKeyOnly
    BeforeUpdateRecord = dspMainDataSetBeforeUpdateRecord
    Left = 156
    Top = 65
  end
  object qry_td_lay: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select * From td_lay--exec p_getlaybydepot 2')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 281
    Top = 251
    object qry_td_layid: TIntegerField
      FieldName = 'id'
    end
    object qry_td_laycode: TStringField
      FieldName = 'code'
      Size = 40
    end
    object qry_td_layname: TStringField
      FieldName = 'name'
      Size = 60
    end
  end
  object qry_tt_billlay: TUniQuery
    SQLInsert.Strings = (
      'INSERT INTO tt_billlay'
      
        '  (id, tid, depotid, productid, layid, bquantity, assqty, create' +
        '_time)'
      'VALUES'
      
        '  (:id, :tid, :depotid, :productid, :layid, :bquantity, :assqty,' +
        ' :create_time)')
    SQLDelete.Strings = (
      'DELETE FROM tt_billlay'
      'WHERE'
      '  id = :Old_id')
    SQLUpdate.Strings = (
      'UPDATE tt_billlay'
      'SET'
      
        '  id = :id, tid = :tid, depotid = :depotid, productid = :product' +
        'id, layid = :layid, bquantity = :bquantity, assqty = :assqty, cr' +
        'eate_time = :create_time'
      'WHERE'
      '  id = :Old_id')
    SQLLock.Strings = (
      'SELECT * FROM tt_billlay'
      'WITH (UPDLOCK, ROWLOCK, HOLDLOCK)'
      'WHERE'
      '  id = :Old_id')
    SQLRefresh.Strings = (
      
        'SELECT id, tid, depotid, productid, layid, bquantity, assqty, cr' +
        'eate_time FROM tt_billlay'
      'WHERE'
      '  id = :Old_id')
    Connection = MainDM.UniConn
    SQL.Strings = (
      'Select *, dbo.f_getunitqty(productid, bquantity, 1) AS qty1,  '
      'dbo.f_getunitqty(productid, bquantity, 2) AS qty2,  '
      'dbo.f_getunitqty(productid, bquantity, 3) AS qty3  '
      'from tt_billlay ')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 225
    Top = 251
  end
  object ds_tt_billlay: TDataSource
    DataSet = cds_tt_billlay
    Left = 225
    Top = 395
  end
  object ds_td_lay: TDataSource
    DataSet = qry_td_lay
    Left = 281
    Top = 299
  end
  object dsp_tt_billlay: TDataSetProvider
    DataSet = qry_tt_billlay
    UpdateMode = upWhereKeyOnly
    BeforeUpdateRecord = dsp_tt_billlayBeforeUpdateRecord
    Left = 225
    Top = 299
  end
  object cds_tt_billlay: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dsp_tt_billlay'
    BeforePost = cds_tt_billlayBeforePost
    OnNewRecord = cds_tt_billlayNewRecord
    OnReconcileError = cds_tt_billlayReconcileError
    Left = 225
    Top = 347
    object cds_tt_billlayid: TIntegerField
      FieldName = 'id'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object cds_tt_billlaytid: TIntegerField
      FieldName = 'tid'
    end
    object cds_tt_billlaydepotid: TIntegerField
      FieldName = 'depotid'
    end
    object cds_tt_billlayproductid: TIntegerField
      FieldName = 'productid'
    end
    object cds_tt_billlaylayid: TIntegerField
      FieldName = 'layid'
    end
    object cds_tt_billlaybquantity: TFloatField
      FieldName = 'bquantity'
    end
    object cds_tt_billlayassqty: TFloatField
      FieldName = 'assqty'
    end
    object cds_tt_billlaycreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cds_tt_billlayqty1: TFloatField
      FieldName = 'qty1'
      OnChange = cds_tt_billlayqty1Change
    end
    object cds_tt_billlayqty2: TFloatField
      FieldName = 'qty2'
      OnChange = cds_tt_billlayqty2Change
    end
    object cds_tt_billlayqty3: TFloatField
      FieldName = 'qty3'
      OnChange = cds_tt_billlayqty3Change
    end
  end
  object poptt_billlay: TPopupMenu
    Left = 121
    Top = 323
    object N3: TMenuItem
      Caption = #26032#22686#25968#25454
      OnClick = N3Click
    end
    object N4: TMenuItem
      Caption = #21024#38500
      OnClick = N4Click
    end
  end
  object qryUpdate: TUniQuery
    Connection = MainDM.UniConn
    Left = 576
    Top = 161
  end
  object MainDataSetU: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      
        'SELECT MIN(tid) AS tid, bid,bstate, bdate, btype, ioflag, 1 as c' +
        'alccost,'
      
        '    MIN(bcode) AS bcode, MIN(bno) AS bno, tb.depotid, productid,' +
        ' SUM(bquantity) '
      
        '    AS bquantity,case when SUM(bquantity) <> 0 then SUM(amount) ' +
        '/ SUM(bquantity)else min(price) end AS bprice ,sum(amount) as am' +
        'ount,'
      
        '    SUM(assqty) AS assqty, MIN(unitid) AS unitid, MIN(unitrate) ' +
        'AS unitrate, td.name as depotname, sum(quantity) quantity,'
      
        '    case when SUM(quantity) <> 0 then SUM(amount) / SUM(quantity' +
        ')else min(price) end AS price,'
      '    dbo.f_getunitqty(productid, sum(quantity), 1) AS qty1,  '
      '    dbo.f_getunitqty(productid, sum(quantity), 2) AS qty2,  '
      '    dbo.f_getunitqty(productid, sum(quantity), 3) AS qty3,'
      
        '    tb.custom1,tb.custom2,tb.custom3,tb.length,tb.width,tb.heigh' +
        't                '
      
        '   FROM tt_bill tb left join td_depot td on tb.depotid = td.depo' +
        'tid'
      '   where btype < 0'
      
        '   GROUP BY tb.depotid, productid,bstate, bdate, bid, btype, td.' +
        'name,ioflag,    '
      
        '            tb.custom1,tb.custom2,tb.custom3,tb.length,tb.width,' +
        'tb.height'
      '   ORDER BY tid')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 152
    Top = 16
  end
  object ds_tb_productimei: TDataSource
    DataSet = qry_tb_productimei
    Left = 453
    Top = 291
  end
  object qry_tb_productimei: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select * From tb_productimei')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    OnNewRecord = qry_tb_productimeiNewRecord
    Left = 449
    Top = 239
    object qry_tb_productimeiid: TIntegerField
      FieldName = 'id'
    end
    object qry_tb_productimeiproductid: TIntegerField
      FieldName = 'productid'
    end
    object qry_tb_productimeiimei: TWideStringField
      FieldName = 'imei'
      Size = 200
    end
    object qry_tb_productimeibtype: TIntegerField
      FieldName = 'btype'
    end
    object qry_tb_productimeibkind: TWordField
      FieldName = 'bkind'
    end
    object qry_tb_productimeibstate: TWordField
      FieldName = 'bstate'
    end
    object qry_tb_productimeibid: TIntegerField
      FieldName = 'bid'
    end
    object qry_tb_productimeibno: TIntegerField
      FieldName = 'bno'
    end
    object qry_tb_productimeidepotid: TIntegerField
      FieldName = 'depotid'
    end
    object qry_tb_productimeiioflag: TIntegerField
      FieldName = 'ioflag'
    end
    object qry_tb_productimeiqtysign: TIntegerField
      FieldName = 'qtysign'
    end
    object qry_tb_productimeicreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object qry_tb_productimeiupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object qry_tb_productimeicheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object qry_tb_productimeiexplan: TWideStringField
      FieldName = 'explan'
      Size = 200
    end
    object qry_tb_productimeiquantity: TFloatField
      FieldName = 'quantity'
      OnChange = qry_tb_productimeiquantityChange
    end
    object qry_tb_productimeiamount: TFloatField
      FieldName = 'amount'
    end
    object qry_tb_productimeirelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object qry_tb_productimeirelationamt: TFloatField
      FieldName = 'relationamt'
    end
    object qry_tb_productimeirelationimei: TIntegerField
      FieldName = 'relationimei'
    end
    object qry_tb_productimeiioqty: TFloatField
      FieldName = 'ioqty'
    end
    object qry_tb_productimeiioassqty: TFloatField
      FieldName = 'ioassqty'
    end
    object qry_tb_productimeirelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object qry_tb_productimeirelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object qry_tb_productimeirelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object qry_tb_productimeiassqty: TFloatField
      FieldName = 'assqty'
    end
    object qry_tb_productimeirelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object qry_tb_productimeiimeibtype: TIntegerField
      FieldName = 'imeibtype'
    end
    object qry_tb_productimeiimeibid: TIntegerField
      FieldName = 'imeibid'
    end
    object qry_tb_productimeiimeibno: TIntegerField
      FieldName = 'imeibno'
    end
    object qry_tb_productimeiimeiid: TIntegerField
      FieldName = 'imeiid'
    end
    object qry_tb_productimeidcamount: TFloatField
      FieldName = 'dcamount'
    end
    object qry_tb_productimeidcrelationamt: TFloatField
      FieldName = 'dcrelationamt'
    end
  end
end
